<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:dg="livcos.org/ns/doc/diagram"
	xmlns:doc="livcos.org/ns/doc"
	xmlns:f="livcos.org/ns/xslt/function"
	xmlns:v="livcos.org/ns/view"
	exclude-result-prefixes="dg f doc v">

	<xsl:import href="/livcos.org/web/diagram/render.xsl"/>
	
	<xsl:template match="dg:diagram">
		<div id="{@id}">
			<xsl:choose>
				<xsl:when test="@align = 'left'">
					<xsl:attribute name="style">float: <xsl:value-of select="@align"/></xsl:attribute>
				</xsl:when>
				<xsl:when test="@align = 'right'">
					<xsl:attribute name="style">float: <xsl:value-of select="@align"/></xsl:attribute>
				</xsl:when>
				<xsl:when test="@align = 'center'">
					<xsl:attribute name="style">text-align: <xsl:value-of select="@align"/></xsl:attribute>
				</xsl:when>
			</xsl:choose>
			<xsl:apply-imports/>
			<xsl:if test="normalize-space(doc:note) != ''">
				<div class="image_note">
					<v:style ref="{resolve-uri('styles.css')}"/>
					<span class="inlineEdit">
						<span class="inlnEd_path" title="note"/>
						<xsl:value-of select="doc:note"/>
					</span>
				</div>
			</xsl:if>
		</div>
	</xsl:template>
	
</xsl:stylesheet>